#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<time.h>

int main()
{
	int i,j,x=10,y=5,score=0;
	char input;
	int isfired=0;
	int iskilled=0;
	int fuck=1;
	int py=2;
	
	
	while(1){
	
	system("cls");
	
	printf("score:%d\n",score);
	if(iskilled==0||fuck==0){
	for(j=0;j<py;j++){
		printf(" ");
    }printf("*\n");
	}
	
	if(isfired==0){
	    for(i=0;i<x;i++){
		    printf("\n");
	} 
	    for(j=0;j<y;j++){
		    printf(" ");
	    }printf("  *\n");
	    for(j=0;j<y;j++){
		    printf(" ");
	    }printf("*****\n");
	    for(j=0;j<y;j++){
		printf(" ");
	    }printf(" * *\n");
	}
	if(isfired==1){
		for(i=0;i<x;i++){
		   for(j=0;j<y;j++){
			printf(" ");	
		}	
		printf("  |\n");
			
	}for(j=0;j<y;j++){
		printf(" ");
	    }printf("  *\n");
        for(j=0;j<y;j++){
		printf(" ");
	    }printf("*****\n");
       	for(j=0;j<y;j++){
	    printf(" ");
	    }printf(" * *\n");
		if(y+2==py){
		   iskilled=1;
		   score++;
		   fuck=0;
		   srand(time(0));
	       py=rand()%10+2;
	    }
	isfired=0;
	}
	
	
	
	input=getch(); 
	
	if(input=='s'){
		x++;
	}
	if(input=='w'){
		x--;
	}
	if(input=='a'){
		y--;
	}
	if(input=='d'){
		y++;
	}
	if(input==' '){
		isfired=1;
	}
}   

	return 0;
}